The present disclosure relates to data storage, and more specifically, hotness based data storage for facilitating garbage collection in storage devices.
For flash drives such as solid state drives (SSDs), data is written in units called “pages.” A page on these storage devices is generally erased before it can be rewritten. Usually, the erase operation can be executed on larger units of storage called “blocks,” each of which is made up of multiple pages. When the data in one or more pages of a block is no longer needed, the block can be reclaimed by a garbage collection (GC) process which moves useful data in the other pages of that block into another previously erased block. Garbage collection is a fundamental process which has direct impact on the performance and endurance of the flash drives.
The garbage collection may be executed in a variety of ways. For example, when a data write request directed towards an invalid page of a block is received, the garbage collection may be initiated to move data in the valid pages to another empty block. The garbage collection may also be started, for example, when the drive I/O (Input/Output) is in an idle state and/or the percentage of invalid pages in a block exceeds a predefined value.